#include <iostream>


/*
    Test Destruct and Construct features;
*/

class Entity
{
    int x, y;
    const char *name;

public:
    // 类的构造方法要放在Public下，否则无法创建实例;
    Entity(const char *name)
    {
        x = 10;
        y = 11;
        this->name = name;
        std::cout << "Construct Entity" << std::endl;
    }
    // 析构函数(destruction) 在实例被销毁时生效;
    ~Entity()
    {
        std::cout << "Destroy Entity:" << name << std::endl;
    }

    void getValue()
    {
        std::cout << x << "," << y << std::endl;
    }
};

class Log
{
public:
    // 删除系统默认构造函数，此时该类无法创建实例，只能使用静态成员变量和静态方法;
    Log() = delete;
    static void Write()
    {
        std::cout << "success!!" << std::endl;
    }
};

void Function()
{
    Entity entity = {"SunWUkong"};
    entity.getValue();
}

int main()
{
    Function();
    return 0;
}